import { createWebHistory, createRouter } from 'vue-router'

import login from '@/views/login/index.vue'
import register from '@/views/register/index.vue'
import home from '@/views/home/index.vue'
import demo from '@/views/home/demo/index.vue'
const routes = [
    {
        path: '/login',
        component: login,
    },
    {
        path: '/register',
        component: register,
    },
    {
        path: '/home',
        component: home,
        children: [
            {
                path: 'demo',
                component: demo,
                meta: { title: 'demo', icon: 'mdi-clipboard-minus-outline' }
            },
        ]
    },
]

const router = createRouter({
    history: createWebHistory(),
    routes,
})

export default router
// https://router.vuejs.org/zh/guide/